package com.bike.bikeserver.controller.backend;

import com.bike.bikeserver.common.annotation.OperationLog;
import com.bike.bikeserver.common.core.domain.CommonResult;
import com.bike.bikeserver.domain.vo.ReplayFeedBackVo;
import com.bike.bikeserver.service.IFeedbackSayingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @version 1.0
 * @Author ZZX
 * @Date 2023/8/3 10:45
 */
@RestController
@RequestMapping("back/feedBackSaying")
public class BackFeedBackSayingController
{
    @Autowired
    IFeedbackSayingService feedbackSayingService;

    /**
     * 查询所有反馈记录
     *
     * @return
     */
    @GetMapping("getAllFeedBackSaying")
    public CommonResult getAllFeedBackSaying()
    {
        return feedbackSayingService.getAllFeedBackSaying();
    }

    /**
     * 回复反馈
     *
     * @param replayFeedBackVo
     * @return
     */
    @OperationLog(value = "根据反馈记录id回复消息:feedback_saying")
    @PutMapping("replyFeedbackSaying")
    public CommonResult replyFeedbackSaying(@RequestBody ReplayFeedBackVo replayFeedBackVo)
    {
        return feedbackSayingService.replyFeedbackSaying(replayFeedBackVo);
    }

    /**
     * 根据回复内容模糊查询
     *
     * @return
     */
    @GetMapping("getUnFeedBackSaying")
    public CommonResult getUnFeedBackSaying(@RequestParam("replyText") String replyText)
    {
        return feedbackSayingService.getUnFeedBackSaying(replyText);
    }

}
